<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>FileUpload XForm - Xui Demo</title>
	<!-- demo data -->
	<link rel="stylesheet" type="text/css" href="../demo.css">
	
	<!-- xui -->
	<link rel="stylesheet" type="text/css" href="../../xui.css">
	<script type="text/javascript" src="../../jquery.min.js"></script>
	<script type="text/javascript" src="../../xui.js"></script>
	
	<!-- xform -->
	<script type="text/javascript">
		$(function(){
			var xform = $("#xform").xform({
				url:"http://localhost:8080/xsoft/upload",		//服务器接口地址
				fileupload:true,								//开启上传文件,默认为false
				success:function(data){							//成功回调
					$(".xinfo").html(data);
				}
			});
			
			$("#submit").click(function(){
				xform.submit();
			});
		})
	</script>
</head>
<body>
	<h2>FileUpload XForm</h2>
	<form class="xform" id="xform">
		<div class="xgroup">
			<label class="g1">尊姓大名</label>
			<div class="g2">
				<input type="text" name="name"/>
			</div>
		</div>
		<div class="xgroup">
			<label class="g1">头像</label>
			<div class="g2">
				<input type="file" name="img"/>
			</div>
		</div>
		<div class="xgroup">
			<div class="g1">&nbsp;</div>
			<div class="g2">
				<span class="xbtn" id="submit">提交</span>
			</div>
		</div>
	</form>
	<div class="xinfo"></div>
</body>
</html>